<?php
/**
 * Created by PhpStorm.
 * User: mofeng
 * Date: 16/9/5
 * Time: 上午9:41
 */
namespace App\Api\Account\Models;

use App\Api\Auth\Models\Users;
use App\Api\Auth\Models\UsersOpenId;
use App\Libs\Wechat\WechatService;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;

class ChatMessage extends Model
{
    protected $table = 'chat_message';

    protected $fillable = [
        'user_id',
        'chat_id',
        'message',
        'type',
        'is_read',
    ];

    static $type = [
        '1' => '文本',
        '2' => '链接',
    ];



    public static function create(array $attributes = [])
    {

        $model = new static($attributes);

        $model->save();

        return $model;
    }
}